package cn.hchaojie.camp.day01;

/**
 * Math类的常用方法
 * 
 * @author hchaojie
 *
 */
public class DemoMath {
	public static void main(String[] args) {
		int min = Math.min(100, 5);
		System.out.println(min);
		
		System.out.println(Math.sqrt(4.0));
		System.out.println(Math.pow(2, 3));
		System.out.println(Math.pow(2, 0.5));
		
		System.out.println(Math.log(Math.E));
		
		System.out.println(Math.random());		// [0, 1)
		
		System.out.println((int) (Math.random() * 6 + 1));	// [1, 7)
		
		System.out.println(Math.ceil(3.1415));
		System.out.println(Math.floor(3.1415));	
		
		
	}
}
